package testPackage;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import testPackage.PageFactoryDemoClass;

import java.util.concurrent.TimeUnit;

/**
 * step by step 12 页面工厂模式
 * PageFactoryDemoClass
 */
public class Testng12 {
    WebDriver driver;
    @Test
    public void verifyUserInfo(){
        System.setProperty("webdriver.chrome.driver","D:\\\\Enviroments\\\\geckodriver-v0.26.0-win64\\\\chromedriver.exe");
       driver = new ChromeDriver();
        driver.get("https://tb.alicdn.com/snapshot/index.html");
        //等待6s
        driver.manage().timeouts().implicitlyWait(6, TimeUnit.SECONDS);
        PageFactoryDemoClass pageFactoryDemoClass = new PageFactoryDemoClass(driver);
        pageFactoryDemoClass.search("女装");
        //LoginPage loginPage = new LoginPage(driver);
        //HomePage homePage = loginPage.loginWithValidCredentials("yixiaobai","yixiaobai123");
        //String userInfo = homePage.showUserInfo();
        //Assert.assertTrue(userInfo.equalsIgnoreCase("yixiaobai"),"Incorrent user info");
    }
}
